 <?
 listProducts();
function listProducts(){
	global $db,$template,$site_base_href;
	
$sql="select* from vb_linksite limit 8" ;
	if(!$result=$db->sql_query($sql)){
	  message_die("Couldn't run the sql query!!!","",__LINE__,__FILE__,$sql);
	}
	$prod_count=$db->sql_numrows($result);
	$prod_data=$db->sql_fetchrowset($result);
 
	 for($i=0;$i<$prod_count;$i++){
		$template->assign_block_vars("proHome", array(						
		 
		'pro'	 =>'<a href="'.$prod_data[$i]['linksite_url'].'" class="lMenu"><img src="'.$site_base_href.'/home/'.$prod_data[$i]['linksite_image'].'" class="imageborder"></a><br><a href="'.$prod_data[$i]['linksite_url'].'" class="lMenu">'.$prod_data[$i]['linksite_name'].'</a>',
		 
			));
	}
	$template->set_filenames(array(
		"homepro"	=> "template/prohome.tpl"
	));
	$template->pparse('homepro');
	unset($prod_data);
	$template->destroy();	
}
 ?>